package day10_io_code.com.itheima.d1_char_stream;

import java.io.FileReader;
import java.io.Reader;

public class FileReaderDemo2 {
    public static void main(String[] args) {
        try (
                Reader fr = new FileReader("d:\\demo\\a.txt");

        ){
            char[] buffer = new char[1024];
            int len;
            while ((len = fr.read(buffer)) != -1){
                String rs = new String(buffer, 0, len);
                System.out.print(rs);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
